package com.hctg.forced2sleep.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.hctg.forced2sleep.R;
import com.hctg.forced2sleep.activity.VideoDetailActivity;
import com.hctg.forced2sleep.bean.MineItem;

import org.jetbrains.annotations.NotNull;

/**
 * description: 描述
 * company    :
 *
 * @author : ldf
 * date       : 2024/6/10 on 11
 * @version 1.0
 */
public class TutorialActivityAdapter extends BaseQuickAdapter<MineItem, BaseViewHolder> {

    public TutorialActivityAdapter() {
        super(R.layout.item_tutorial_activity);
        setOnItemClickListener((adapter, view, position) -> {
            MineItem item = getItem(position);
            VideoDetailActivity.start(getContext(), item.name, null, "http://images.skyingidea.com/app_info.mp4");
        });
    }

    @Override
    protected void convert(@NotNull BaseViewHolder holder, MineItem item) {
        holder.setText(R.id.tv_title, item.name)
                .setGone(R.id.tv_content, true);
    }
}
